{% extends "base.html" %}
{% load i18n %}
{% load user_timezone %}

{% block body %}
  <table width="100%" border="0" class="pmtable">
    <colgroup>
      <col width="*">
      <col width="160">
      <col width="160">
    </colgroup>
    <thead>
      <tr>
        <th>{% trans "Title" %}</th>
        <th>{% trans "Sender" %}</th>
        <th>{% trans "Time" %}</th>
      </tr>
    </thead>
    <tbody>
      {% for message in messages %}
        <tr>
          <td>
            <a href="/pm/read/{{ message.key.id }}"
            {% if not message.is_read %}
              class="unread"
            {% endif %}>
              {{ message.title }}
            </a>
          </td>
          <td>
            <a href="/u/{{ message.sender.key.name }}">
              {{ message.sender.nickname }}
              [{{ message.sender.user.email|slice:":6"}}...]
            </a>
          </td>
          <td>{{ message.message_time|user_timezone:time_zone|date:"Y-m-d H:i:s" }}</td>
        </tr>
      {% endfor %}
    </tbody>
  </table>
{% endblock %}